/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.config.autoconfigure;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.tianyun.cloud.config.console.ConsolePropertySourceLocator;
import org.tianyun.cloud.config.console.endpoint.ConsolePropertysEndpoint;
import org.tianyun.cloud.config.console.endpoint.ConsoleRefreshEndpoint;

/**
 * 配置中心自动配置类
 *
 * @auther ebert_chan
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Endpoint.class)
public class CloudConfigEndpointAutoConfiguration {

    @Bean
    @ConditionalOnBean(ConsolePropertySourceLocator.class)
    public ConsolePropertysEndpoint consolePropertysEndpoint() {
        return new ConsolePropertysEndpoint();
    }

    @Bean
    @ConditionalOnBean(ConsolePropertySourceLocator.class)
    public ConsoleRefreshEndpoint consoleRefreshEndpoint() {
        return new ConsoleRefreshEndpoint();
    }

}
